/**
 * @Title StringPrintWriter.java
 * @Package com.eppear.jpfm.framework.exception
 * @Description
 * @author JianFeng Zhang(张建锋)
 * @date 2016-12-27 下午9:22:24
 * @version 
 */
package com.eppear.jpfm.framework.exception;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @ClassName StringPrintWriter
 * @Description
 *         自定义异常信息到字符串类
 * @author JianFeng Zhang(张建锋)
 * @date   2016-12-27 下午9:22:24
 *
 */
public class StringPrintWriter extends PrintWriter {

	public StringPrintWriter(){  
        super(new StringWriter());  
    }
	public StringPrintWriter(int initialSize) {  
        super(new StringWriter(initialSize));  
  }  
   
  public String getString() {  
        flush();  
        return ((StringWriter) this.out).toString();  
  }  
   
  @Override  
  public String toString() {  
      return getString();  
  }  

}
